home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
CD-ROM Magazine 28 Bonus
/
CDRomMagazine-SoftKey-ArtPassion-FrenchVersion-Win31Mac.bin
/
data
/
shared.dir
/
03025_Script_MENU HANDLERS
< prev
next >
Wrap
Text File
|
1996-06-21
|
8KB
|
266 lines
-- --------------------------------------------------------------------------------------
-- Handler initMenu
on initMenu
-- difference between the top of the menubutton and the bottom of the
-- menubar
global menuBarOffset
set menuBarOffset = 1
global MenuEnableList
set MenuEnableList = []
setMenuItemEnable 1, TRUE
setMenuItemEnable 2, TRUE
setMenuItemEnable 3, TRUE
setMenuItemEnable 4, TRUE
setMenuItemEnable 5, TRUE
setMenuItemEnable 6, TRUE
setMenuItemEnable 7, TRUE
hideMenu
end
-- --------------------------------------------------------------------------------------
-- Handler checkMenuButtonRoll checks if the user rolled over the menu button and, if so,
-- hilites the currently rolled-over segment.
on checkMenuButtonRoll mousePoint
global menuBar, menuVisible, menuButtonRect
if (NOT menuVisible) AND (inside(mousePoint, menuButtonRect)) then
showMenu
else if menuVisible then
if (NOT rollover(menuBar)) AND (NOT inside(mousePoint, menuButtonRect)) then
hideMenu
else
doMenuRoll
end if
end if
end
-- --------------------------------------------------------------------------------------
-- Handler showMenu
on showMenu
global menuBar, menuVisible, fingerCursor, menuH, menuV
set the locH of sprite menuBar = menuH
set the locV of sprite menuBar = menuV
set the cursor of sprite menuBar = fingerCursor
set menuVisible = 1
updateStage
end
-- --------------------------------------------------------------------------------------
-- Handler hideMenu
on hideMenu
global menuBar, menuVisible, hilitMenuSeg
removeFromStage(menuBar)
removeFromStage(hilitMenuSeg)
set the cursor of sprite menuBar = -1
set menuVisible = 0
setHilitedMenuItem 0
updateStage
end
-- --------------------------------------------------------------------------------------
-- Handler doMenuClicked determines what menu item the user clicked
-- and sends an appropriate message to the handler processMenuClick.
on doMenuClicked
global numMenuItems, menuBar, hilitMenuSeg
set aSeg = getVButtonIndexOffSet(menuBar, numMenuItems, the mouseV)
activateButton(hilitMenuSeg)
updateStage
processMenuClick aSeg
end
-- --------------------------------------------------------------------------------------
-- Handler doMenuRoll
on doMenuRoll
global numMenuItems, menuBar
hiliteMenuItem ( getVButtonIndexOffSet(menuBar, numMenuItems, the mouseV))
end
-- --------------------------------------------------------------------------------------
-- Handler hiliteMenuItem
on hiliteMenuItem aSeg
global menuBar, menuHiliteLocations, hilitMenuSeg
-- if the currently rolledover item (aSeg) is not already hilited and the
-- currently rolledover item (aSeg) is enabled, hilite it
if NOT (getHilitedMenuItem() = aSeg) then
setHilitedMenuItem aSeg
if IsEnabledMenuItem(aSeg) then
set the castNum of sprite hilitMenuSeg = the number of cast ("hiliteSeg" & aSeg)
set the locH of sprite hilitMenuSeg = value(item 1 of line aseg of menuHiliteLocations)
set the locV of sprite hilitMenuSeg = value(item 2 of line aseg of menuHiliteLocations)
else
removeFromStage(hilitMenuSeg)
end if
end if
end
-- --------------------------------------------------------------------------------------
-- Handler IsEnabledMenuItem
on IsEnabledMenuItem whichItem
global numMenuItems, MenuEnableList
if (whichItem < 1) OR (whichItem > numMenuItems) then
return FALSE
else
return getAt(MenuEnableList, whichItem)
end if
end
-- --------------------------------------------------------------------------------------
-- Handler setMenuItemEnable
on setMenuItemEnable whichItem, trueOrFalse
global MenuEnableList
setAt MenuEnableList, whichItem, trueOrFalse
end
-- --------------------------------------------------------------------------------------
-- Handler getHilitedMenuItem
on getHilitedMenuItem
global currentHilitedMenuItem
return currentHilitedMenuItem
end
-- --------------------------------------------------------------------------------------
-- Handler setHilitedMenuItem
on setHilitedMenuItem whichItem
global currentHilitedMenuItem
set currentHilitedMenuItem = whichItem
end
-- --------------------------------------------------------------------------------------
-- Handler processMenuClick executes whatever item the user clicked on the menu.
on processMenuClick itemClicked
global menuVisible
set menuVisible = FALSE
if itemClicked = 1 then
goMain
else if itemClicked = 2 then
goTour
else if itemClicked = 3 then
goIndex
else if itemClicked = 4 then
goHelp
else if itemClicked = 5 then
goDataBase
else if itemClicked = 6 then
goTimeLine
else if itemClicked = 7 then
DoQuit
end if
end
-- ---------------------------------------------------------------
-- Handler goTimeLine
on goTimeLine
goSection ("TLmain1",1)
end
-- ---------------------------------------------------------------
-- Handler goPrevScene is called when the user
on goPrevScene
global backFrame, backMovie
goScene(backFrame,backMovie)
end
-- ---------------------------------------------------------------
-- Handler goMain is called when the user clicks Main on the
-- menu bar. It takes the user to the main world.
on goMain
goSection("CR1",1)
end
-- ---------------------------------------------------------------
-- Handler goTour is the handler use to go from one section in
-- the product to another.
on goTour
global currentsection
setMouseDownScriptEmpty -- Added by ET Oct. 2, 95
addSectionToBackList(currentsection)
setBackFlag(FALSE)
setSectionButtonCursors("-1") -- reset the cursors of the old section
turnOffPuppet
goMovie("ArtTour.dir", "TourSt")
end
-- ---------------------------------------------------------------
-- Handler goIndex is called when the user clicks Index on the
-- menu bar. It takes the user to the index.
on goIndex
goSection ("IXmain1",1)
end
-- ---------------------------------------------------------------
-- Handler doQuit is called when the user clicks Quit on the
-- menu bar. It quits the program.
on doQuit
global sectionmovie
if sectionmovie = "ArtCredt.dir" then
unblackoutscreen
quit
else
goMovie ("ArtCredt.dir","StartCred")
set sectionmovie = "ArtCredt.dir"
end if
end
-- ---------------------------------------------------------------
-- Handler goHelp is called when the user clicks Help on the
-- menu bar. It takes the user to the help section.
on goHelp
goSection ("HelpSt",1)
end
-- ---------------------------------------------------------------
-- Handler goDatabase is called when the user clicks Database on the
-- menu bar. It takes the user to the database.
on goDatabase
goSection ("DBst",1)
end
-- --------------------------------------------------------------------------------------
-- Handler setUpMenu is called from goSection. It resets values at the beginning of
-- a new section.
on setUpMenu
global menuBar, menuVisible, hilitMenuSeg
set the castNum of sprite menuBar = the number of cast "hiliteSeg0"
puppetSprite menuBar, TRUE
puppetSprite hilitMenuSeg, TRUE
removeFromStage(menuBar)
removeFromStage(hilitMenuSeg)
set menuVisible = FALSE
end
--